<extend name="_layout/main"/>
<block name="content">
    <div class="page-content">
        <div class="page-breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="{:U('dashboard/index')}">系统首页</a>
                </li>
                <li>
                    <a href="{:U('setting/index')}">系统设置</a>
                </li>
                <li class="active">默认参数</li>
            </ul>
        </div>

        <div class="page-body">
            <div class="row">
                <div class="col-xs-12 col-md-12">
                    <div class="widget">
                        <div class="widget-header bordered-bottom bordered-blue">
                            <span class="widget-caption">默认参数【所有参数修改会立即生效，请谨慎操作】</span>
                        </div>
                        <div class="widget-body">

                            <form class="form-horizontal" role="form" action="{:U('setting/save')}" method="post"
                                  id="form">

                                <div class="form-group">
                                    <label for="min_user_active_amount" class="col-sm-2 control-label no-padding-right">激活报单金额</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <span class="input-group-addon">￥</span>
                                            <input type="text" class="form-control" name="min_user_active_amount"
                                                   placeholder=""
                                                   value="{$Think.config.setting.min_user_active_amount}">
                                        </div>
                                        <p class="help-block red">会员激活报单最低额度，或是该金额的整数倍</p>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="min_user_operations_amount"
                                           class="col-sm-2 control-label no-padding-right">申请运营中心报单金额</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <span class="input-group-addon">￥</span>
                                            <input type="text" class="form-control" name="min_user_operations_amount"
                                                   value="{$Think.config.setting.min_user_operations_amount}">
                                        </div>
                                        <p class="help-block red">申请运营中心报单最低额度</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="min_operations_count" class="col-sm-2 control-label no-padding-right">申请运营中心最低邀请数</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="min_operations_count"
                                                   value="{$Think.config.setting.min_operations_count}">
                                            <span class="input-group-addon">人</span>
                                        </div>
                                        <p class="help-block red">邀请并成功激活的最少会员数</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="pay_balance_percent"
                                           class="col-sm-2 control-label no-padding-right">现金支付比例</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="pay_balance_percent"
                                                   placeholder=""
                                                   value="{$Think.config.setting.pay_balance_percent}">
                                            <span class="input-group-addon">%</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="pay_integral_percent"
                                           class="col-sm-2 control-label no-padding-right">积分支付比例</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="pay_integral_percent"
                                                   placeholder=""
                                                   value="{$Think.config.setting.pay_integral_percent}">
                                            <span class="input-group-addon">%</span>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="active_parent_integral_percent"
                                           class="col-sm-2 control-label no-padding-right">激活用户上级获得奖励基数</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control"
                                                   name="active_parent_integral_percent"
                                                   placeholder=""
                                                   value="{$Think.config.setting.active_parent_integral_percent}">
                                            <span class="input-group-addon">%</span>
                                        </div>
                                        <p class="help-block red">用户激活成功后，直接上级获得的奖励 = 基数% * 成功激活下级会员数 </p>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="active_unstore_integral_cycle"
                                           class="col-sm-2 control-label no-padding-right">待用积分默认周期</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="active_unstore_integral_cycle"
                                                   placeholder=""
                                                   value="{$Think.config.setting.active_unstore_integral_cycle}">
                                            <span class="input-group-addon">天</span>
                                        </div>
                                        <p class="help-block red">激活成功转为待用积分周期</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="active_unstore_integral_multiple"
                                           class="col-sm-2 control-label no-padding-right">待用积分默认返利</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control"
                                                   name="active_unstore_integral_multiple"
                                                   placeholder=""
                                                   value="{$Think.config.setting.active_unstore_integral_multiple}">
                                            <span class="input-group-addon">倍</span>

                                        </div>
                                        <p class="help-block red">激活成功转为待用积分周期收益</p>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="active_user_reward"
                                           class="col-sm-2 control-label no-padding-right">隔代获取的报酬比例</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="active_user_reward"
                                                   placeholder=""
                                                   value="{$Think.config.setting.active_user_reward}">
                                            <span class="input-group-addon">%</span>

                                        </div>
                                        <p class="help-block red">激活成功隔代上级可以获得的奖励占整个报单金额的比例</p>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="min_recharge_amount" class="col-sm-2 control-label no-padding-right">最低充值金额</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <span class="input-group-addon">￥</span>
                                            <input type="text" class="form-control" name="min_recharge_amount"
                                                   placeholder=""
                                                   value="{$Think.config.setting.min_recharge_amount}">
                                        </div>
                                        <p class="help-block red">运营中心充值最低金额</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="recharge_reward"
                                           class="col-sm-2 control-label no-padding-right">充值奖励</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="recharge_reward"
                                                   placeholder=""
                                                   value="{$Think.config.setting.recharge_reward}">
                                            <span class="input-group-addon">%</span>
                                        </div>
                                        <p class="help-block red">充值奖励</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="normal_to_stored_reward"
                                           class="col-sm-2 control-label no-padding-right">可用转待用隔代报酬</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="normal_to_stored_reward"
                                                   placeholder=""
                                                   value="{$Think.config.setting.normal_to_stored_reward}">
                                            <span class="input-group-addon">%</span>

                                        </div>
                                        <p class="help-block red">会员可用积分转待用积分隔代获取的报酬</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="use_to_store_cycle" class="col-sm-2 control-label no-padding-right">可用转待用积分周期</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="use_to_store_cycle"
                                                   placeholder=""
                                                   value="{$Think.config.setting.use_to_store_cycle}">
                                            <span class="input-group-addon">天</span>
                                        </div>
                                        <p class="help-block red">可用转待用积分周期</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="use_to_store_returns" class="col-sm-2 control-label no-padding-right">可用转待用积分倍数</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="use_to_store_returns"
                                                   placeholder=""
                                                   value="{$Think.config.setting.use_to_store_returns}">
                                            <span class="input-group-addon">倍</span>
                                        </div>
                                        <p class="help-block red">可用转待用积分，获得周期收益</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="sign_integral"
                                           class="col-sm-2 control-label no-padding-right">签到积分</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="sign_integral"
                                                   placeholder=""
                                                   value="{$Think.config.setting.sign_integral}">
                                        </div>
                                        <p class="help-block red">每日签到赠送的积分</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="order_integral_cycles"
                                           class="col-sm-2 control-label no-padding-right">订单积分返还周期</label>
                                    <div class="col-xs-2">
                                        <div class="input-group">
                                            <input type="text" class="form-control" name="order_integral_cycles"
                                                   placeholder=""
                                                   value="{$Think.config.setting.order_integral_cycles}">
                                            <span class="input-group-addon">天</span>
                                        </div>
                                        <p class="help-block red">购买商品支付的积分，返还周期</p>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <button type="submit" class="btn btn-blue">保存</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>

<block name="footer">

    <script src="__PUBLIC__/assets/js/validation/bootstrapValidator.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $("#form").bootstrapValidator({
            excluded: [':disabled'],
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            submitHandler: function (validator, form, submitButton) {
                validator.defaultSubmit();
            },
            fields: {

                min_user_operations_amount: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        }
                    }
                },
                min_user_active_amount: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        }
                    }
                },
                min_operations_count: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        }
                    }
                },

                pay_balance_percent: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },
                        between: {
                            min: 0,
                            max: 100,
                            message: '该数值在0 ~ 100之间',
                        }
                    }
                },
                pay_integral_percent: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },
                        between: {
                            min: 0,
                            max: 100,
                            message: '该数值在0 ~ 100之间',
                        }
                    }
                },
                active_unstore_integral_cycle: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },

                    }
                },
                active_unstore_integral_percent: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },
                        between: {
                            min: 0,
                            max: 100,
                            message: '该数值在0 ~ 100之间',
                        }
                    }
                },
                active_unstore_integral_multiple: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },
                        between: {
                            min: 0,
                            max: 100,
                            message: '该数值在0 ~ 100之间',
                        }
                    }
                },
                active_user_reward: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },
                        between: {
                            min: 0,
                            max: 100,
                            message: '该数值在0 ~ 100之间',
                        }
                    }
                },
                normal_to_stored_reward: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },
                        between: {
                            min: 0,
                            max: 100,
                            message: '该数值在0 ~ 100之间',
                        }
                    }
                },
                min_recharge_amount: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },

                    }
                },
                use_to_store_returns: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },

                    }
                },
                use_to_store_cycle: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },

                    }
                },
                sign_integral: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },

                    }
                },
                recharge_reward: {
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },

                    }
                },
                order_integral_cycles:{
                    validators: {
                        notEmpty: {
                            message: '该项不能为空'
                        },
                        digits: {
                            message: '必须为数字'
                        },

                    }
                }
            }
        });

    </script>
</block>